<?php 
$groups = ClassRegistry::getObject("Config")->getConfigGroups();

?>
<script src="<?php echo $html->url('/config/js/jquery.tabs.min.js');?>"></script>
<script src="<?php echo $html->url('/config/js/jquery.history_remote.pack.js');?>"></script>
<script src="<?php echo $html->url('/cms/js/jquery.validate.min.js');?>"></script>

<script type="text/javascript">
$(function() {
	$('#configuration').tabs();
	
	var validator = $("#configForm").bind("invalid-form.validate", function() {
			alert('<?php echo __("Please fill all the fields required in different sections.")?>');
		}).validate();
});
</script>

<link rel="stylesheet" href="<?php echo $html->url('/config/css/jquery.tabs.css');?>" type="text/css" media="print, projection, screen">
<!-- Additional IE/Win specific style sheet (Conditional Comments) -->
<!--[if lte IE 7]>
<link rel="stylesheet" href="<?php echo $html->url('/config/css/jquery.tabs-ie.css');?>" type="text/css" media="projection, screen">
<![endif]-->
<br /><br />
<?php 
	echo $form->create("Config",array('url'=>"/".$this->params['url']['url']));
?>
<div id="configuration">
	<ul>
		<?php 
			foreach($groups as $group)
			{	?>
				<li>
					<?php 
							$label = "<span>".__($group)."</span>";
							echo $html->link($label,'#config-'.$group,array("escape"=>false))?>
				</li>
			<?php }
		?>
	</ul>
	<?php 
		foreach($groups as $group)
		{?>
			<div id="config-<?php echo $group;?>">
				<?php echo $form->inputs(array("legend"=>false),null,$group);?>
			</div>
		<?php }
	?>
</div>
<?php 
	echo $form->end(__("Submit"));
?>